package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.impl.BusinessServiceImpl;
import com.sky.vo.BusinessDataVO;
import com.sky.vo.DishOverViewVO;
import com.sky.vo.OrderOverViewVO;
import com.sky.vo.SetmealOverViewVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/workspace")
@Slf4j
public class BusinessController {

    @Autowired
    private BusinessServiceImpl businessServiceImpl;


    @GetMapping("/businessData")
    public Result businessData() {
        BusinessDataVO result = businessServiceImpl.businessData();
        return Result.success(result);
    }

    @GetMapping("/overviewSetmeals")
    public Result overviewSetmeals() {
        SetmealOverViewVO result = businessServiceImpl.overviewSetmeals();
        return Result.success(result);
    }

    @GetMapping("/overviewDishes")
    public Result overviewDishes() {
        DishOverViewVO result = businessServiceImpl.overviewDishes();
        return Result.success(result);
    }

    @GetMapping("/overviewOrders")
    public Result overviewOrders() {
        OrderOverViewVO result = businessServiceImpl.overviewOrders();
        return Result.success(result);
    }
}
